import { commonRequest } from '@/api/commonHttp';

// 商品基础 - 获取计量单位列表
export const getUnitListService = (data, loadingFn) => commonRequest({
  url: '/sysback/unit/baseQueryList',
  type: 'post',
  data,
  loadingFn
});

// 商品基础 - 新增计量单位
export const addUnitService = (data, loadingFn) => commonRequest({
  url: '/sysback/unitaudit/baseAdd',
  type: 'post',
  data,
  loadingFn
});

// 商品基础 - 获取计量单位详情
export const getUnitDetailsService = (data, loadingFn) => commonRequest({
  url: '/sysback/unit/getUnitByUuid',
  // url: '/sysback/unit/baseGetByUuid',
  type: 'post',
  data,
  loadingFn,
  // isFormData: true
});

// 商品基础 - 编辑计量单位
export const editUnitService = (data, loadingFn) => commonRequest({
  url: '/sysback/unitaudit/updateUnitAudit',
  type: 'post',
  data,
  loadingFn
});

// 商品基础 - 获取计量单位详情-审核未通过
export const getUnitDetailsForNoPassService = (data, loadingFn) => commonRequest({
  url: '/sysback/unitaudit/baseGetByUuid',
  type: 'post',
  data,
  loadingFn,
  isFormData: true
});

// 商品基础 - 编辑计量单位 - 审核未通过
export const editUnitForNoPassService = (data, loadingFn) => commonRequest({
  url: '/sysback/unitaudit/updateFromNoPass',
  type: 'post',
  data,
  loadingFn
});

// 商品基础 - 获取计量单位组
export const getUnitGroupListService = (data, loadingFn) => commonRequest({
  url: '/sysback/unitGroup/queryUnitGroupList',
  type: 'post',
  data,
  loadingFn
});
